overviewControls: Bind state adjustment signals to parent lifetime
On tests shutdown we were sometimes getting this error:
** Message: 09:29:27.494: Shutting down GNOME Shell
(gnome-shell:
3728700): Gjs-CRITICAL **: 09:29:27.545:
JS ERROR: TypeError: this._workspacesDisplay is undefined
_update@resource:///org/gnome/shell/ui/overviewControls.js:599:37
_initializeUI/<@resource:///org/gnome/shell/ui/main.js:279:14
Which after using the arrow function becomes:
(gnome-shell:
3731979): Gjs-CRITICAL **: 09:30:05.419:
JS ERROR: TypeError: this._workspacesDisplay is undefined
_update@resource:///org/gnome/shell/ui/overviewControls.js:599:37
_init/<@resource:///org/gnome/shell/ui/overviewControls.js:343:67
_initializeUI/<@resource:///org/gnome/shell/ui/main.js:279:14
This is because the state adjustement object lifetime is not bound to
the ControlsManager, and so we were potentially accessing to invalid
data
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3943>
(cherry picked from commit
935c5a0c540237ea7d1b8e38141577ac20669662)